Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

csv export options need to be HashWithIndifferentAccess #2741

Merged
merged 3 commits into from
Nov 19, 2016

Conversation

loicginoux
Copy link
Contributor

a correction for this bug.
#2740

@@ -32,6 +32,7 @@ def initialize(objects = [], schema = {})
end

def to_csv(options = {})
options = HashWithIndifferentAccess.new(options)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Calling symbolize_keys! would be a bit simpler, I guess.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this is easier but I prefered to use the safest option. First, not knowing the rest of the code and the consequences, I prefered to be able to use string and symbol as keys, to be safe. Also, you suggestion would actually be to use .deep_symbolize_keys!
At least using HashWithIndifferentAccess, I am sure I am not introducing any regression.

@mshibuya
Copy link
Member

mshibuya commented Nov 5, 2016

Test code needed.

@mshibuya
Copy link
Member

mshibuya commented Nov 9, 2016

Can be merged when rubocop offenses are resolved.
https://travis-ci.org/sferik/rails_admin/jobs/174276072#L425-L430

@loicginoux
Copy link
Contributor Author

done.

@mshibuya mshibuya merged commit 81f612f into railsadminteam:master Nov 19, 2016
@mshibuya
Copy link
Member

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants